Donnerstag, 28. Juni 2018

User Defined Transform - per Collection

DS seems to be very picky. The only working solution found, is
record = DataManager.NewDataRecord()
i = 0
while i < Collection.Size():
    Collection.GetRecord(record, i + 1)
    record.SetField(u'SECURE_ID',
                    unicode(hashlib.sha512(uuid.uuid4().hex).hexdigest()))
Not working with raising AttributeError,name are the following to snippets. (In contrast, those work in the mock.)
record = DataManager.NewDataRecord()
for record in Collection.records:
    record.SetField(u'SECURE_ID', # raise AttributeError,name
                    unicode(hashlib.sha512(uuid.uuid4().hex).hexdigest()))
record = DataManager.NewDataRecord()
num_o_records = Collection.Size()
for i in range(1, num_o_records + 1):
    Collection.GetRecord(record, i + 1)
    record.SetField(u'SECURE_ID', # raise AttributeError,name
                    unicode(hashlib.sha512(uuid.uuid4().hex).hexdigest()))

Keine Kommentare:

Kommentar veröffentlichen