Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
a_f:a:create [2022/09/01 01:23] – ↷ Page moved from a_f:3100_actions:create to a_f:a:create administratora_f:a:create [2024/05/16 03:35] (current) – [Example] aware_admin
Line 1: Line 1:
-{{tag>Actions Action_List Business_Object Process References Lists}}+{{tag>Index Action Action_List Business_Object Process References Lists}}
 ====== CREATE ====== ====== CREATE ======
  
Line 10: Line 10:
 where Id() is identifier of the business object to create, for example  where Id() is identifier of the business object to create, for example 
  
-<code aim> CREATE Account +<code aim>CREATE Account </code>
-</code>+
  
 and Arithmetic Operation is an expression producing a string indicating the name of the object to create.  and Arithmetic Operation is an expression producing a string indicating the name of the object to create. 
Line 21: Line 20:
 ===== Example ===== ===== Example =====
  
-<code aim> CREATE Account WITH Account.State='Open', Account.Balance=0</code>+<code aim>CREATE Account WITH Account.State='Open', Account.Balance=0 </code>
  
 The attributes to be initialized must follow the ''WITH'' keyword and must be separated by comma. Any arithmetic operation is valid as the initialization expression. The attributes to be initialized must follow the ''WITH'' keyword and must be separated by comma. Any arithmetic operation is valid as the initialization expression.
Line 30: Line 29:
  
 This action will create as many instances of the object as there are instances of another business object in the Context. For example,  This action will create as many instances of the object as there are instances of another business object in the Context. For example, 
-<code aim> CREATE Transaction FOR EACH Account</code>+<code aim>CREATE Transaction FOR EACH Account </code>
  
     ''CREATE'' Id() ''FOR EACH'' ( ''DAY'' | ''WEEK'' | ''MONTH'' | ''QUARTER'' | ''YEAR'' | ''WEEK_DAY'' | ''WEEKEND_DAY'' ) ''BETWEEN'' ArithmeticOperation() ''AND'' ArithmeticOperation     ''CREATE'' Id() ''FOR EACH'' ( ''DAY'' | ''WEEK'' | ''MONTH'' | ''QUARTER'' | ''YEAR'' | ''WEEK_DAY'' | ''WEEKEND_DAY'' ) ''BETWEEN'' ArithmeticOperation() ''AND'' ArithmeticOperation
    
 This action will create as many instances of the specified business object as there are days(weeks/months/quarters/years) in the specified date interval. Note that the Arithmetic Operations here must be operations on dates, for example, This action will create as many instances of the specified business object as there are days(weeks/months/quarters/years) in the specified date interval. Note that the Arithmetic Operations here must be operations on dates, for example,
-<code aim> CREATE Transaction FOR EACH DAY BETWEEN Account.OpeningDate AND Account.ClosingDate</code> +<code aim>CREATE Transaction FOR EACH DAY BETWEEN Account.OpeningDate AND Account.ClosingDate </code> 
  
 The date interval includes both starting and ending dates.  The date interval includes both starting and ending dates. 
  
 Note also that if the object being created has any attributes of the Date type, these attributes can be initialized with the value of the date for which the object is being created. For example,  Note also that if the object being created has any attributes of the Date type, these attributes can be initialized with the value of the date for which the object is being created. For example, 
-<code aim> CREATE Transaction FOR EACH DAY BETWEEN Account.OpeningDate AND Account.ClosingDate WITH Transaction.AppliedDate=Day</code> Every transaction created in this way will have the AppliedDate attribute initialized to the day for which the transaction is created.+<code aim>CREATE Transaction FOR EACH DAY BETWEEN Account.OpeningDate AND Account.ClosingDate WITH Transaction.AppliedDate=LOOP_ITERATION</code> Every transaction created in this way will have the AppliedDate attribute initialized to the day for which the transaction is created. 
 + 
 +    ''CREATE'' Id() ''FOR EACH DATE IN '' ArithmeticOperation() 
 + 
 +This action will create as many instances of the specified business object as there are dates in the attribute storing text with Multi-Dates content. Note that the Arithmetic Operations here must be resolved to a string with multi-dates content (type of the text attribute must be Multi-Dates), for example 
 +<code aim>CREATE Transaction FOR EACH DATE IN SomeObject.SelectedDates WITH Transaction.AppliedDate=LOOP_ITERATION </code> 
 + 
 +    ''CREATE'' Id() ''FOR EACH STRING IN '' ArithmeticOperation() [ DELIMITER ] 
 + 
 +This action will create as many instances of the specified business object as there are substrings in the attribute storing a delimited string. The default delimiter is '@', but the delimiter can also be specified, for example 
 +<code aim>CREATE Transaction FOR EACH STRING IN SomeObject.DelimitedString '#' WITH Transaction.Substring=LOOP_ITERATION </code>
  
     ''CREATE'' Id() ''FOR EACH NUMBER BETWEEN'' ArithmeticOperation() ''AND'' ArithmeticOperation     ''CREATE'' Id() ''FOR EACH NUMBER BETWEEN'' ArithmeticOperation() ''AND'' ArithmeticOperation
    
 This action will create as many instances of the specified business object as there are numbers in the specified interval. Note that the Arithmetic Operations here must be operations on numbers, for example, This action will create as many instances of the specified business object as there are numbers in the specified interval. Note that the Arithmetic Operations here must be operations on numbers, for example,
-<code aim> CREATE Transaction FOR EACH NUMBER BETWEEN 1 AND 3</code>The interval includes both starting and ending numbers.+<code aim>CREATE Transaction FOR EACH NUMBER BETWEEN 1 AND 3 </code>The interval includes both starting and ending numbers.
  
    * ''CREATE'' Id() ''FOR EACH FILE IN'' ArithmeticOperation()    * ''CREATE'' Id() ''FOR EACH FILE IN'' ArithmeticOperation()
  
 This action will create as many instances of the specified business object as there are files in the specified directory. The Arithmetic Operation used in the expression must produce a string specifying the directory in which the system will look for files. For example, This action will create as many instances of the specified business object as there are files in the specified directory. The Arithmetic Operation used in the expression must produce a string specifying the directory in which the system will look for files. For example,
-<code aim> CREATE Attachment FOR EACH FILE IN 'c:/mydirectory'</code> +<code aim>CREATE Attachment FOR EACH FILE IN 'c:/mydirectory' </code> 
  
 Note also that if the object being created has any attributes of the Document type, these attributes can be initialized with the file for which the object is being created. For example,  Note also that if the object being created has any attributes of the Document type, these attributes can be initialized with the file for which the object is being created. For example, 
  
-<code aim> CREATE Attachment FOR EACH FILE IN 'c:/mydirectory' WITH Attachment.Document=File</code> +<code aim>CREATE Attachment FOR EACH FILE IN 'c:/mydirectory' WITH Attachment.Document=File </code> 
  
 Every attachment object created in this way will have the Document attribute initialized to the file for which the attachment is being created. Every attachment object created in this way will have the Document attribute initialized to the file for which the attachment is being created.
  • Last modified: 2022/09/13 18:11