Apply address layout to all addresses of type
Product line
Standard
|Expert
Operating mode
CLOUD ABO
|ON-PREMISES
Modules
Services & CRM
Budget & Phases
Purchases
Resource Planning
Business Intelligence
Takes the address layout of the current address and carries over it to all addresses from the same Address type (simple address, company, person, contact or couple).
Version | description | Scripting |
---|---|---|
from version 5.8 | Python scripting | AddLayoutToAllOfType.py |
Single address containing the layout to be transferred.
#---Description: Carry over the address layout of one address to another # Class: Address Entry # ObjectScript: Yes # ContainerScript: No # EventType: None #---This script takes the address layout of the current # address and carries over it to all address entries that # are of the same type (Single Address, Company, Person or Contact). #---30.01.2004, Vertec AG: created #---07.05.2007, sr: Adapted to argobject and vertec #---04.03.2008, cp: Supplement by dynamic Formofaddress and salutation #---30.04.2009, bn: On Error added to intercept errors #---25.10.2013, sr: changed msgox to vertec.msgbox #---22.02.2019, sth: Script rewritten in Python def main(): vtcapp.updatedatabase obj = argobject if obj.eval('oclisKindOf(address)'): layout = obj.defaultaddress lay = layout.adresslayout typ = obj.evalocl(“oclType.asString”) adrlist = vtcapp.evalocl(type + “.allInstances”) for address in adrlist: try: address.anredetemplate = obj.anredetemplate address.briefanredetemplate = obj.briefanredetemplate layout = address.defaultaddress layout.adresslayout = lay except: if vtcapp.msgbox(“The address layout could not be set for the following address: %s. Do you want to continue?” % address.evalocl(“self.asstring”),4) == 6: continue else: return else: vtcapp.msgbox(“This script must be executed on a single address from which the layout will be carried over to all addresses of this type.”) vtcapp.updatedatabase main()