# Setting pricelist name

**URL:** <https://forum.litium.com/t/setting-pricelist-name/1116>\
**Category:** Questions\
**Tags:** litium-7\
**Created:** [September 24, 2019, 8:50am UTC](https://forum.litium.com/t/setting-pricelist-name/1116 "2019-09-24T08:50:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christian.Engvall](https://avatars.discourse-cdn.com/v4/letter/c/919ad9/32.png) [@Christian.Engvall](https://forum.litium.com/u/Christian.Engvall)\
**Post date:** [September 24, 2019, 8:50am UTC](https://forum.litium.com/t/setting-pricelist-name/1116/1 "2019-09-24T08:50:27Z")

</div>

Hi!

I am creating pricelists in code in a scheduled task( **ITask** ).  
It works well, but I would like to set the name property for the pricelists, but it doesn’t seem to get saved.

I am using this code, but when i look in backoffice the pricelist has no name

```
    public PriceList CreatePriceListConnectedToOrganization(Organization organization, Currency currency, string priceListId, string name)
    {
        var priceList = new PriceList(currency.SystemId);
        priceList.Active = true;
        priceList.Id = priceListId;
        priceList.IncludeVat = false;
        priceList.Localizations.CurrentUICulture.Name = name;
        priceList.Localizations.CurrentCulture.Name = name;
        priceList.OrganizationLinks = new List<PriceListToOrganizationLink>()
        {
            new PriceListToOrganizationLink(organization.SystemId)
        };
        _priceListService.Create(priceList);
        return priceList;
    }

```

And this is the result

 ![pricelist](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/206e5415b28bb4fed2919a64e9bec3662f7c3709.png)

Am i supposed to set the name some other way?

Litium version: 7.2.0

---

<div class="post-metadata">

**Author:** ![NilsN](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/nilsn/32/302_2.png) [@NilsN](https://forum.litium.com/u/NilsN)\
**Post date:** [September 24, 2019, 9:17am UTC](https://forum.litium.com/t/setting-pricelist-name/1116/2 "2019-09-24T09:17:36Z")

</div>

You need to add the name with the culture key as index.  
`priceList.Localizations["sv-SE"].Name = name;`

You can use the LanguageService to get all languages in the solution.

---

<div class="post-metadata">

**Author:** ![Christian.Engvall](https://avatars.discourse-cdn.com/v4/letter/c/919ad9/32.png) [@Christian.Engvall](https://forum.litium.com/u/Christian.Engvall)\
**Post date:** [September 24, 2019, 9:30am UTC](https://forum.litium.com/t/setting-pricelist-name/1116/3 "2019-09-24T09:30:21Z")

</div>

Thanks!

```
        foreach (var language in _languageService.GetAll())
        {
            priceList.Localizations[language.CultureInfo].Name = name;
        }
```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/12eddac3b8b661de1db86af10ac8151b571e6fb9.png) [@system](https://forum.litium.com/u/system)\
**Post date:** [October 22, 2019, 9:30am UTC](https://forum.litium.com/t/setting-pricelist-name/1116/4 "2019-10-22T09:30:22Z")

</div>

Closed on October 22, 2019, 9:30am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
