Tuesday, December 28, 2021

Container function in D365fo

Hi guys, today our topic is Container function in D365fo      

Container: It will stores the multiple values with multiple data types.


    container  myContainer= ['Hi',1,2,'Hello'];

    anytype    value;
 
    ConIns:
        Insert the values into container.
    
        myContainer = conIns(myContainer,1,'test1');
    
    ConPeek:
        Get the value from container.

        value  = conPeek(myContainer,1);//your container name, position.

    ConPoke:
        Update the value in container.

        myContainer = conpoke(myContainer,1,'test2');
    
    Condel:
        Delete the values from Container.
    
        secondContainer =conDel(secondContainer,2,1);

    ConNull:    
        clear all the value from container.
    
        myContainer = conNull() ;

    ConLen:
        Find the length of the container.

        int lenght= conLen(myContainer);

    Confind:
        This function is return the Position of searched value. 
            if value is not found it will return 0.

        int position = conFind(secondContainer,'Hello');

 
    Con2Str:
        This function is used to convert container to string. 

        str     string= con2Str(secondContainer);

    Con2List:

        This function converts the container into list.

        List myList = con2List(secondContainer);
    
    Con2Buf: converts container into record. con2Buf(myContainer, mytable); ConView: It will show the container values. conView(myContainer); str2Con: It converts string into container. str2Con(string); str2Con(string, '/');// It will separate the values upon '/'.

    Convert Set into container:
    
        Set         records = new Set(Types::Int64);
        container   packed  = records.pack();
    
    Convert Set into container:
    
        SetIterator     recordsIterator = new SetIterator(Set::create(container));
                                            
 

     Loop the container:

    for (int i = 1; counter <=conLen(secondContainer); i++)
    {
        info(conPeek(secondContainer, i));
    }


 Keep Daxing!!

No comments:

Post a Comment